package com.kfm.jdbc.day0405;

import com.sun.source.tree.NewArrayTree;

public class Demo02 {

    public static void main(String[] args) {
        Cook cook = new Cook();

        CookThread cookThread = new CookThread(cook);
        cookThread.start();

        EatThread eatThread = new EatThread(cook, "吃货一号");
        EatThread eatThread2 = new EatThread(cook, "吃货二号");
        EatThread eatThread3 = new EatThread(cook, "吃货三号");
        eatThread.start();
        eatThread2.start();
        eatThread3.start();

        while(true){
            System.out.println("make = " + cookThread.getState() + " , eat = " + eatThread.getState()+ " , eat2 = " + eatThread2.getState()+ " , eat3 = " + eatThread3.getState());
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
